package se137.hrbust.hlgshopping137.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 购物车表
 * @TableName tb_cart137
 */
@TableName(value ="tb_cart137")
@Data
public class Cart137 implements Serializable {
    /**
     * 购物车项ID
     */
    @TableId(value = "FId", type = IdType.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    @TableField(value = "FUserId")
    private Long userid;

    /**
     * 商品ID
     */
    @TableField(value = "FProductId")
    private Long productid;

    /**
     * SKU ID
     */
    @TableField(value = "FSKUId")
    private Long skuid;

    /**
     * 商品名称
     */
    @TableField(value = "FName137")
    private String name137;

    /**
     * 商品属性文本
     */
    @TableField(value = "FAttrsText137")
    private String attrstext137;

    /**
     * 商品图片URL
     */
    @TableField(value = "FPicture137")
    private String picture137;

    /**
     * 商品价格
     */
    @TableField(value = "FPrice")
    private BigDecimal price;

    /**
     * 当前价格
     */
    @TableField(value = "FNowPrice")
    private BigDecimal nowprice;

    /**
     * 当前原价
     */
    @TableField(value = "FNowOriginalPrice")
    private BigDecimal noworiginalprice;

    /**
     * 是否选中：0-未选中，1-选中
     */
    @TableField(value = "FSelected")
    private Integer selected;

    /**
     * 库存数量
     */
    @TableField(value = "FStock")
    private Integer stock;

    /**
     * 购买数量
     */
    @TableField(value = "FCount")
    private Integer count;

    /**
     * 是否有效：0-无效，1-有效
     */
    @TableField(value = "FIsEffective")
    private Integer iseffective;

    /**
     * 是否收藏：0-未收藏，1-已收藏
     */
    @TableField(value = "FIsCollect")
    private Integer iscollect;

    /**
     * 运费
     */
    @TableField(value = "FPostFee")
    private BigDecimal postfee;

    /**
     * 创建时间
     */
    @TableField(value = "FCreateTime")
    private LocalDateTime createtime;

    /**
     * 更新时间
     */
    @TableField(value = "FUpdateTime")
    private LocalDateTime updatetime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Cart137 other = (Cart137) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getProductid() == null ? other.getProductid() == null : this.getProductid().equals(other.getProductid()))
            && (this.getSkuid() == null ? other.getSkuid() == null : this.getSkuid().equals(other.getSkuid()))
            && (this.getName137() == null ? other.getName137() == null : this.getName137().equals(other.getName137()))
            && (this.getAttrstext137() == null ? other.getAttrstext137() == null : this.getAttrstext137().equals(other.getAttrstext137()))
            && (this.getPicture137() == null ? other.getPicture137() == null : this.getPicture137().equals(other.getPicture137()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getNowprice() == null ? other.getNowprice() == null : this.getNowprice().equals(other.getNowprice()))
            && (this.getNoworiginalprice() == null ? other.getNoworiginalprice() == null : this.getNoworiginalprice().equals(other.getNoworiginalprice()))
            && (this.getSelected() == null ? other.getSelected() == null : this.getSelected().equals(other.getSelected()))
            && (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock()))
            && (this.getCount() == null ? other.getCount() == null : this.getCount().equals(other.getCount()))
            && (this.getIseffective() == null ? other.getIseffective() == null : this.getIseffective().equals(other.getIseffective()))
            && (this.getIscollect() == null ? other.getIscollect() == null : this.getIscollect().equals(other.getIscollect()))
            && (this.getPostfee() == null ? other.getPostfee() == null : this.getPostfee().equals(other.getPostfee()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getProductid() == null) ? 0 : getProductid().hashCode());
        result = prime * result + ((getSkuid() == null) ? 0 : getSkuid().hashCode());
        result = prime * result + ((getName137() == null) ? 0 : getName137().hashCode());
        result = prime * result + ((getAttrstext137() == null) ? 0 : getAttrstext137().hashCode());
        result = prime * result + ((getPicture137() == null) ? 0 : getPicture137().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getNowprice() == null) ? 0 : getNowprice().hashCode());
        result = prime * result + ((getNoworiginalprice() == null) ? 0 : getNoworiginalprice().hashCode());
        result = prime * result + ((getSelected() == null) ? 0 : getSelected().hashCode());
        result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode());
        result = prime * result + ((getCount() == null) ? 0 : getCount().hashCode());
        result = prime * result + ((getIseffective() == null) ? 0 : getIseffective().hashCode());
        result = prime * result + ((getIscollect() == null) ? 0 : getIscollect().hashCode());
        result = prime * result + ((getPostfee() == null) ? 0 : getPostfee().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userid=").append(userid);
        sb.append(", productid=").append(productid);
        sb.append(", skuid=").append(skuid);
        sb.append(", name137=").append(name137);
        sb.append(", attrstext137=").append(attrstext137);
        sb.append(", picture137=").append(picture137);
        sb.append(", price=").append(price);
        sb.append(", nowprice=").append(nowprice);
        sb.append(", noworiginalprice=").append(noworiginalprice);
        sb.append(", selected=").append(selected);
        sb.append(", stock=").append(stock);
        sb.append(", count=").append(count);
        sb.append(", iseffective=").append(iseffective);
        sb.append(", iscollect=").append(iscollect);
        sb.append(", postfee=").append(postfee);
        sb.append(", createtime=").append(createtime);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}